package com.tengju.payment.domain.model.channel;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;


//渠道状态
@AllArgsConstructor
public enum ChannelStatus {

    NORMAL(10,"正常"),

    CLOSE(20,"关闭");



    private int val;
    private String desc;

    @JsonValue
    public int getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static ChannelStatus fromVal(int val) {
        for (ChannelStatus data : values()) {
            if (data.val == val) {
                return data;
            }
        }
        return null;
    }


}
